package web.tablas;

import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

public class Proveedor extends SortableDataProvider<Wasd>{
	private static final long serialVersionUID = 1L;
	private List<Wasd> wasds;
	
	public Proveedor() {
		this.wasds = new LinkedList<Wasd>();
	}

	public Iterator<? extends Wasd> iterator(int first, int count) {
		Collections.sort(wasds);
		return wasds.iterator();
	}

	public int size() {
		return wasds.size();
	}

	public IModel<Wasd> model(Wasd object) {
		return new Model<Wasd>(object);
	}

	public void agregar(Wasd wasd){
		this.wasds.add(wasd);
	}
	//getters&setters
	public void setWasds(List<Wasd> wasds) {
		this.wasds = wasds;
	}
	public List<Wasd> getWasds() {
		return wasds;
	}
}